<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <meta charset="utf-8"/>
    <title>     &raquo; \tfc\saf
</title>
    <meta name="author" content=""/>
    <meta name="description" content=""/>

            <link href="../css/template.css" rel="stylesheet" media="all"/>
    
            <!--[if lt IE 9]>
        
        <![endif]-->
        <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
        <script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script>
        <script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script>
        <script src="../js/bootstrap.js" type="text/javascript"></script>
        <script src="../js/template.js" type="text/javascript"></script>
        <script src="../js/prettify/prettify.min.js" type="text/javascript"></script>
    
            <link rel="shortcut icon" href="../img/favicon.ico"/>
        <link rel="apple-touch-icon" href="../img/apple-touch-icon.png"/>
        <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png"/>
        <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png"/>
    </head>
<body>

        <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span> <span class="icon-bar"></span>
                    <span class="icon-bar"></span> </a>
                <a class="brand" href="http://www.trotri.com/">Trotri官网</a><a class="brand" href="../index.html">TFC-Trotri Foundation Classes</a>

                <div class="nav-collapse">
                    <ul class="nav">
                        <li class="dropdown">
                            <a href="#api" class="dropdown-toggle" data-toggle="dropdown">
                                API Documentation <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                                                    <li><a>Namespaces</a></li>
                                                                        <li><a href="../namespaces/tfc.html">tfc</a></li>
                                                                                                                                </ul>
                        </li>
                        <li class="dropdown" id="charts-menu">
                            <a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
                                Charts <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="../graph_class.html">
                                        <i class="icon-list-alt"></i>&#160;Class hierarchy diagram
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown" id="reports-menu">
                            <a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
                                Reports <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="../errors.html">
                                         
                                    </a>
                                </li>
                                <li>
                                    <a href="../markers.html">
                                        <i class="icon-list-alt"></i>&#160;Markers
                                    </a>
                                </li>
                                <li>
                                    <a href="../deprecated.html">
                                        <i class="icon-list-alt"></i>&#160;Deprecated
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="go_to_top">
            <a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>
        </div>
    </div>
    
    <div id="___" class="container">
        <noscript>
            <div class="alert alert-warning">
                Javascript is disabled; several features are only available if Javascript is enabled.
            </div>
        </noscript>

        
            
    <div class="row">

        <div class="span4">
            <div class="btn-group view pull-right" data-toggle="buttons-radio">
                <button class="btn details" title="Show descriptions and method names">
                    <i class="icon-list"></i></button><button class="btn simple" title="Show only method names">
                    <i class="icon-align-justify"></i>
                </button>
            </div>
            <ul class="side-nav nav nav-list">
                <li class="nav-header">
                    <i class="icon-map-marker"></i> Namespaces
                </li>
                    
    
            </ul>
        </div>

        <div class="span8 namespace-contents">
                
    
        <ul class="breadcrumb">
            <li><a href="../index.html"><i class="icon-th"></i></a></li>
                
                
    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.html">tfc</a>
    </li>

    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.saf.html">saf</a>
    </li>

        </ul>

                    <div class="namespace-indent">
                <h3><i class="icon-custom icon-function"></i> Functions</h3>
                                        <div id="function_spl_autoload" class="element ajax clickable function" data-toggle="collapse" data-target="#function_spl_autoload .collapse">
        <h1>spl_autoload<a href="../namespaces/tfc.saf.html#function_spl_autoload">¶</a></h1>
        <p class="short_description">自动加载PHP文件</p>
        <div class="details collapse"></div>
        <a href="../namespaces/tfc.saf.html#function_spl_autoload" class="more">« More »</a>    </div>

                                        <div id="function_debug_dump" class="element ajax clickable function" data-toggle="collapse" data-target="#function_debug_dump .collapse">
        <h1>debug_dump<a href="../namespaces/tfc.saf.html#function_debug_dump">¶</a></h1>
        <p class="short_description">测试打印数据，只有DEBUG或者强制的时候才输出</p>
        <div class="details collapse"></div>
        <a href="../namespaces/tfc.saf.html#function_debug_dump" class="more">« More »</a>    </div>

                                        <div id="function_debug_print_r" class="element ajax clickable function" data-toggle="collapse" data-target="#function_debug_print_r .collapse">
        <h1>debug_print_r<a href="../namespaces/tfc.saf.html#function_debug_print_r">¶</a></h1>
        <p class="short_description">测试打印数据，只有DEBUG或者强制的时候才输出</p>
        <div class="details collapse"></div>
        <a href="../namespaces/tfc.saf.html#function_debug_print_r" class="more">« More »</a>    </div>

                            </div>
        
        
                    <div class="namespace-indent">
                <h3><i class="icon-custom icon-class"></i> Classes, interfaces and traits</h3>
                
                
                                        <div id="class_Cookie" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Cookie .collapse">
        <h1>Cookie<a href="../classes/tfc.saf.Cookie.html">¶</a></h1>
        <p class="short_description">Cookie class file
Cookie管理类，所有的Cookie都应该加密后保存</p>
        <div class="details collapse"><p>配置 /cfg/app/appname/main.php：</p>
<pre>
return array (
  'cookie' => array (
     'key_name' => 'authentication', // 密钥配置名
     'domain' => '.trotri.com',      // Cookie的有效域名，缺省：当前域名
     'path' => '/',                  // Cookie的有效服务器路径，缺省：/
     'secure' => false,              // FALSE：HTTP和HTTPS协议都可传输；TRUE：只通过加密的HTTPS协议传输，缺省：FALSE
     'httponly' => true,             // TRUE：只能通过HTTP协议访问；FALSE：HTTP协议和脚本语言都可访问，容易造成XSS攻击，缺省：TRUE
  ),
);
</pre></div>
        <a href="../classes/tfc.saf.Cookie.html" class="more">« More »</a>    </div>

                                        <div id="class_Mef" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Mef .collapse">
        <h1>Mef<a href="../classes/tfc.saf.Mef.html">¶</a></h1>
        <p class="short_description">Mef class file
可逆的加密算法管理类，Mcrypt Encryption Functions</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.saf.Mef.html" class="more">« More »</a>    </div>

                                        <div id="class_Text" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Text .collapse">
        <h1>Text<a href="../classes/tfc.saf.Text.html">¶</a></h1>
        <p class="short_description">Text class file
当前项目的语言国际化管理类</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.saf.Text.html" class="more">« More »</a>    </div>

                                        <div id="class_UpProxy" class="element ajax clickable class" data-toggle="collapse" data-target="#class_UpProxy .collapse">
        <h1>UpProxy<a href="../classes/tfc.saf.UpProxy.html">¶</a></h1>
        <p class="short_description">UpProxy class file
上传代理操作类</p>
        <div class="details collapse"><p>配置 /cfg/app/appname/main.php：</p>
<pre>
return array (
  'upload' => array(
    'posts' => array(
      'directory' => 'imgs/thumb', // 上传目录名，在根目录：DIR_DATA_UPLOAD下，如：DIR_DATA_UPLOAD . '/imgs/thumb'
      'name_pre' => '',
      'name_rule' => 0, // 保存文件时的命名规则，0：原文件名、1：随机整数格式、2：随机字符串格式、3：日期和时间格式、4：日期和时间+随机整数格式、5：日期和时间+随机字符串格式、6：时间戳格式、7：时间戳+随机整数格式、8：时间戳+随机字符串格式
      'dir_rule' => 'Ym/d', // 目录名规则，由日期时间组成，如：DIR_DATA_UPLOAD . '/imgs/thumb/201410/04'
      'max_size' => 2097152, // 允许上传的文件大小最大值，单位：字节
      'allow_types' => array(
        'image/pjpeg',
        'image/jpeg',
        'image/gif',
        'image/png',
        'image/xpng',
        'image/wbmp',
        'image/bmp',
        'image/x-png'
      ),
      'allow_exts' => 'jpg|gif|png|bmp|zip|rar',
      'allow_replace_exists' => false, // 如果保存文件的地址已经存在其他文件，是否允许替换
      'dt_format' => 'YmdHis',
      'join_str' => '_',
      'rand_min' => 10000,
      'rand_max' => 99999,
      'rand_strlen' => 16 // 8 ~ 32之间
    ),
    'sysbatch' => array(
      ...
    ),
  ),
)
</pre></div>
        <a href="../classes/tfc.saf.UpProxy.html" class="more">« More »</a>    </div>

                                        <div id="class_Keys" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Keys .collapse">
        <h1>Keys<a href="../classes/tfc.saf.Keys.html">¶</a></h1>
        <p class="short_description">Keys class file
密钥管理类</p>
        <div class="details collapse"><p>配置 /cfg/key/cluster.php：</p>
<pre>
return array (
  'authentication' => array (
    'crypt' => string,   // 加密密钥
    'sign' => string,    // 签名密钥
    'expiry' => integer, // 缺省的密文有效期，如果等于0，表示永久有效，单位：秒
    'rnd_len' => integer // 随机密钥长度，取值 0-32
  ),
  'site' => array (
    'crypt' => string,   // 加密密钥
    'sign' => string,    // 签名密钥
    'expiry' => integer, // 缺省的密文有效期，如果等于0，表示永久有效，单位：秒
    'rnd_len' => integer // 随机密钥长度，取值 0-32
  )
);
</pre></div>
        <a href="../classes/tfc.saf.Keys.html" class="more">« More »</a>    </div>

                                        <div id="class_DbProxy" class="element ajax clickable class" data-toggle="collapse" data-target="#class_DbProxy .collapse">
        <h1>DbProxy<a href="../classes/tfc.saf.DbProxy.html">¶</a></h1>
        <p class="short_description">DbProxy class file
数据库代理操作类，连接失败尝试重试、记录操作日志、主从数据库连接管理（待扩展）</p>
        <div class="details collapse"><p>配置 /cfg/db/cluster.php：</p>
<pre>
return array (
  'service' => array (
    'dsn' => string,      // Data Source Name
    'username' => string, // 数据库用户名
    'password' => string, // 数据库密码
    'charset' => string,  // 数据库字符编码
    'retry' => integer,   // 连接数据库失败后，尝试重连的最大次数
    'tblprefix' => string // 表前缀
  ),
  'administrator' => array (
    'dsn' => 'mysql:host=localhost;dbname=trotri',
    'username' => 'root',
    'password' => '123456',
    'charset' => 'utf8',
    'retry' => 3,
    'tblprefix' => 'tr_'
  ),
);
</pre></div>
        <a href="../classes/tfc.saf.DbProxy.html" class="more">« More »</a>    </div>

                                        <div id="class_Log" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Log .collapse">
        <h1>Log<a href="../classes/tfc.saf.Log.html">¶</a></h1>
        <p class="short_description">Log class file
日志处理类</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.saf.Log.html" class="more">« More »</a>    </div>

                                        <div id="class_RalProxy" class="element ajax clickable class" data-toggle="collapse" data-target="#class_RalProxy .collapse">
        <h1>RalProxy<a href="../classes/tfc.saf.RalProxy.html">¶</a></h1>
        <p class="short_description">RalProxy class file
Ral代理操作类，调用CURL失败重试、记录操作日志、负载均衡管理（待扩展）</p>
        <div class="details collapse"><p>配置 /cfg/ral/cluster.php：</p>
<pre>
return array (
  'administrator' => array (
    'server' => string,               // 服务器IP地址
    'port' => integer,                // 服务器端口号
    'connect_time_out_ms' => integer, // 链接超时：毫秒
    'time_out_ms' => integer,         // 执行超时：毫秒
    'converter' => string,            // 执行后返回数据类型
    'retry' => integer,               // 重试次数
  ),
  'site' => array (
    'server' => '127.0.0.1',
    'port' => 80,
    'connect_time_out_ms' => 200,
    'time_out_ms' => 500,
    'converter' => 'json',
    'retry' => 1,
  ),
);
</pre></div>
        <a href="../classes/tfc.saf.RalProxy.html" class="more">« More »</a>    </div>

                                        <div id="class_Cfg" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Cfg .collapse">
        <h1>Cfg<a href="../classes/tfc.saf.Cfg.html">¶</a></h1>
        <p class="short_description">Cfg class file
获取配置类</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.saf.Cfg.html" class="more">« More »</a>    </div>

                            </div>
            
    
        </div>
    </div>
    </div>

        <footer class="span12">
            Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by
            <a href="http://glyphicons.com/">Glyphicons</a>.<br/>
            Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and<br/>
            generated on Sat, 27 Dec 2014 06:16:37 +0000.<br/>
    </footer>
    </body>
</html>
